import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
// https://vitejs.dev/config/
export default defineConfig({
  build: {
    // 非生产环境主动开启 sourcemap，以便小程序端源码调试
    sourcemap: process.env.NODE_ENV === "production" ? false : true,
  },
  plugins: [
    uni({
      vueOptions: {
        reactivityTransform: true,
      },
    }),
  ],
  configureWebpack: {
    resolve: {
      fallback: {
        canvas: false,
        fs: false,
        http: false,
        https: false,
        url: false,
        zlib: false,
      },
    },
  },
});
